/*******************************************************************************
* InfoEx
*******************************************************************************/
Mappl.Tool.InfoEx = Ext.extend( Mappl.Tool.PointInfoQuery, {

    beforeAction : function() {
        this.runtime.on( 'onInfoQueryResult', this.onResult, this );
    }
    
    , beforeQuery : function( aQuery ) {
	    this.runtime.on( 'onInfoQueryResult', this.onResult, this );
        aQuery.resultMode = 'xml';
    }
    
    , onResult : function() {
        this.runtime.un( 'onInfoQueryResult', this.onResult, this );
        
        //console.dir( this.runtime.geoInfoResult );
/*
        var objects = new Array();
        
        var geoInfoResult = this.runtime.geoInfoResult ;
        for ( var j = 0, m = geoInfoResult.layers.array.length; j < m; j++ ) {
            var layer   = geoInfoResult.layers.array[j];
            
            for ( var o = 0, k = layer.infoObjects.array.length; o < k; o++ ) {
                var gisObj = layer.infoObjects.array[o];

                var infoObj = {
                      okey  : gisObj.code.get()
                    , lcode : layer.code.get()
                };
                
                for ( var fld in gisObj ) {
                    if ( fld != 'code' ) {
                        infoObj[ fld.toLowerCase() ] = gisObj[ fld ];
                    }
                }
                //alert( k + ' ' + Ext.encode( infoObj ) );
                                
                //console.dir( infoObj );
                objects[ objects.length ] = infoObj;
            }
        }
*/

		//console.dir(objects);

    }
} );